import json
from selenium import webdriver

browser = webdriver.Chrome()
browser.get('https://login.taobao.com/member/login.jhtml?redirectURL=http%3A%2F%2Fbuyertrade.taobao.com%2Ftrade%2Fitemlist%2Flist_bought_items.htm%3Fspm%3D875.7931836%252FB.a2226mz.4.66144265Vdg7d5%26t%3D20110530')
#  扫码
input('请回车登陆')
dictCookies = browser.get_cookies()
jsonCookies = json.dumps(dictCookies)  # str
# 登陆完成后，将cookies保存到本地文件
with open("cookies_taobao.json", "w") as f:
    f.write(jsonCookies)



